<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
<script>
   var arrReduce =  [0,1,2,3,4].reduce(((prevVal,curVal) => prevVal + curVal),20);
   console.log(arrReduce);
   var flattened = [[0, 1], [2, 3], [4, 5]].reduce(function(a, b) {
       return a.concat(b);
   }, []);//扁平化二维数组
   console.log(flattened)
   console.log([[0, 1], [2, 3], [4, 5]].join(",").split(","));
   console.log(Array.from({length: 10}, (item, index) => index))  //产生连续的数[0,1,2,3,4]
</script>
</body>
</html>